package com.future.hedongjun.home.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.future.baselib.utils.GlideUtils;
import com.future.hedongjun.R;
import com.future.hedongjun.home.bean.CategoryBean;

import java.util.List;

/**
 * @author jniu
 * @Email niuxiaoqi@hztianque.com
 * @time 2018/11/14
 */
public class CategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseViewHolder> {

    public CategoryAdapter(@Nullable List<CategoryBean> data) {
        super(R.layout.recycler_item_category, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CategoryBean item) {
        helper.setText(R.id.tv_title, item.getCate_name());
        GlideUtils.loadImage(mContext, item.getIcon_img(), (ImageView) helper.getView(R.id.iv_icon));
    }
}
